<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}仓库管理系统{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="{% url 'warehouse:dashboard' %}">仓库管理系统</a>
            <div class="navbar-nav ms-auto">
                {% if user.is_authenticated %}
                    <span class="navbar-text me-3">欢迎, {{ user.username }}</span>
                    <form method="post" action="{% url 'logout' %}" class="d-inline">
                        {% csrf_token %}
                        <button type="submit" class="btn btn-link nav-link">登出</button>
                    </form>
                {% else %}
                    <a class="nav-link" href="{% url 'login' %}">登录</a>
                {% endif %}
            </div>
        </div>
    </nav>

    <div class="container-fluid mt-4">
        {% block content %}
        {% endblock %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>